import request from '@/utils/request'

// 保存数据
export function salesOrderAdd(data) {
  return request({
    url: '/SalesManage/SalesOrder/AddAPI',
    method: 'post',
    data: data
  })
}

// 查询列表
export function salesOrderList(params,page) {
  return request({
    url: '/SalesManage/SalesOrder/ListJson',
    method: 'post',
    params: params,
    data:page,
    headers: {
      'Content-Type': 'application/form-urlencoded'
    }
  })
}


// 查询列表明细
export function salesOrderListDetails(params) {
  return request({
    url: '/SalesManage/SalesOrder/ListJsons',
    method: 'post',
    params: params,
  })
}



// 查询存货列表
export function ComboBoxDataList(params) {
  return request({
    url: '/SalesManage/Material/ComboBoxData',
    method: 'post',
    params: params
  })
}



// 删除订单
export function salesOrderDelete(data) {
  return request({
    url: '/SalesManage/SalesOrder/delete',
    method: 'post',
    params: data
  })
}




// 订单审核
export function salesOrderCheck(data) {
  return request({
    url: '/SalesManage/SalesOrder/toexamine',
    method: 'post',
    params: data
  })
}




// 订单弃审
export function salesOrderUnCheck(data) {
  return request({
    url: '/SalesManage/SalesOrder/toexamineqs',
    method: 'post',
    params: data
  })
}


// 订单关闭
export function salesOrderClose(data) {
  return request({
    url: '/SalesManage/SalesOrder/OrderClosingZY',
    method: 'post',
    params: data
  })
}



// 订单变更新增
export function SalesChangeOrder(data) {
  return request({
    url: '/SalesManage/SalesChangeOrder/Add',
    method: 'post',
    data: data
  })
}


// 查询变更明细
export function salesOrderChangeListDetails(params) {
  return request({
    url: '/SalesManage/SalesChangeOrder/ListJsons',
    method: 'post',
    params: params,
  })
}



// 变更单审核
export function salesChangeOrderCheck(data) {
  return request({
    url: '/SalesManage/SalesChangeOrder/toexamine',
    method: 'get',
    params: data
  })
}


// 查询列表
export function salesOrderChangeList(params,page) {
  return request({
    url: '/SalesManage/SalesChangeOrder/ListJson',
    method: 'post',
    params: params,
    data:page,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 删除变更单
export function salesOrderChangeDelete(data) {
  return request({
    url: '/SalesManage/SalesChangeOrder/delete',
    method: 'post',
    params: data
  })
}